<div class="slideshow">
    <div id="myCarousel" class="carousel slide">
        <ol class="carousel-indicators">
            <?php
                $i=0;
                foreach ($advs as $adv):
                $style = $i==0?"active":"";    
            ?>
            <li data-target="#myCarousel" data-slide-to="<?php echo $i;?>" class="<?php echo $style; $i++; ?>"></li>
            <?php endforeach;?>
        </ol>
        <!-- Carousel items -->
        <div class="carousel-inner">
            <?php
            $i=1;
            foreach ($advs as $adv):
            $url_path = $adv->url_path == "#Click vào đây để thay đổi đường dẫn ảnh" ? "#" : $adv->url_path;
            $title = ($adv->title == NULL || $adv->title == 'Title') ? '' : $adv->title;
            $style = $i==1?"active":"";
            $width  = isset($mobile)?' width="100%"':' width="1008px"';
            ?>
            <div class="<?php echo $style;?> item"><a href="<?php echo $url_path; ?>"><img src="/images/advs/<?php echo $adv->image_name; ?>" <?php echo $width; ?> alt="<?php echo $title; ?>" title="<?php echo $title; $i++; ?>"></a></div>
            <?php endforeach; ?>
        </div>
    </div>
</div>


